package com.wabbei.friendcenter.action;

import java.util.List;

import javax.servlet.ServletContext;

import org.apache.struts2.ServletActionContext;

import com.webbei.friendcenter.service.MyFriendCenter;
import com.webbei.pojo.Commission;
import com.webbei.pojo.Customs;

public class ChestAction {
	
	private String uname;
	private List<Commission> commission;
	private List<Customs> custom;//my cost money message----my money part
	private MyFriendCenter friservice;
	private double customAllMoney;
	private double commissionAllMoney;
	
	public String twoListfind(){
		//uname=ServletActionContext.getContext().getSession().get(key);
		uname="chenhao";
		custom=friservice.getCostMoneyMessageByUserName(uname);
		commission=friservice.getAllCommissionByUserName(uname);
		customAllMoney=0.0;
		commissionAllMoney=0.0;
		for(Commission m:commission){
			commissionAllMoney+=m.getGetMoney();
		}
		for(Customs c:custom){
			customAllMoney+=c.getCustomPrice();
		}
		//System.out.println(customAllMoney+","+commissionAllMoney);
		//System.out.println(commission.toString());
		//System.out.println(custom.toString());
		return "list";  
	}
	public String execute(){
		return null;
	}
	public double getCustomAllMoney() {
		return customAllMoney;
	}
	public void setCustomAllMoney(double customAllMoney) {
		this.customAllMoney = customAllMoney;
	}
	public double getCommissionAllMoney() {
		return commissionAllMoney;
	}
	public void setCommissionAllMoney(double commissionAllMoney) {
		this.commissionAllMoney = commissionAllMoney;
	}
	/*public MyFriendCenter getFriservice() {
		use $.getJSON() this method can't have
		return friservice;
	}*/
	public void setFriservice(MyFriendCenter friservice) {
		this.friservice = friservice;
	}
	public List<Commission> getCommission() {
		return commission;
	}
	public void setCommission(List<Commission> commission) {
		this.commission = commission;
	}
	public List<Customs> getCustom() {
		return custom;
	}
	public void setCustom(List<Customs> custom) {
		this.custom = custom;
	}
	public String getUname() {
		return uname;
	}
	public void setUname(String uname) {
		this.uname = uname;
	}
	
}
